package com.example.travelapplication.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.example.travelapplication.entity.Reservation;

import java.util.List;

@Dao
public interface RsvDao {
    @Query("SELECT * FROM rsv")
    List<Reservation> getAllRsv();

    @Query("SELECT * FROM rsv where rsvId = :rsvId")
    Reservation getRsvById(int rsvId);

    @Query("SELECT * FROM rsv where attId = :attId")
    Reservation getRsvByAttId(int attId);

    @Query("DELETE FROM rsv")
    void deleteAll();

    @Insert
    void add(Reservation reservation);

    @Delete
    void delete(Reservation reservation);

    @Update
    void update(Reservation reservation);
}
